<template>
	<view class="u-m-l-30 default-bg">
		<view v-for="(item, index) in dataList" :key="index" class="u-m-t-10" @click="handleNav(item)">
			<image :src="item.imageUrl" style="height: 284rpx; border-radius: 15rpx; width: 100%;"></image>
		</view>
	</view>
	
</template>

<script>
	import {jumpTypeEnum} from '@/common/const.js'
	import {getShopEquityList} from '@/api/equity.js'
	export default{
		data(){
			return{
				dataList:[]
			}
		},
		methods:{
			/**
			 * 初始化
			 */
			init(){
				getShopEquityList().then(res=>{
					let data = res.data
					data.forEach(item=>{
						let images = JSON.parse(item.bannerImages)
						if(images && images.length > 0){
							item.imageUrl = images[0].materialUrl
						}
					})
					this.dataList = data
					this.$emit('equityLoadCompleted', data)
				})
			},
			
			/**
			 * 权益包详情
			 */
			handleNav(item){
				this.jumpUtil.jumpTo(jumpTypeEnum.navigate, `/pages_one/equity/detail?id=${item.id}`, false)
			}
		}
	}
</script>

<style scoped>
	.default-bg{
		border-radius: 30rpx 0rpx 0rpx 30rpx;
		padding: 30rpx 30rpx 40rpx 30rpx;
		background: linear-gradient(270deg, #FF9D34 0%, #FFB455 45%, #FFCF7C 100%);
	}
</style>